﻿namespace Cos.Core.NHibernate
{
    public class PageGroupAccessPK
    {
        public virtual string ApplicationName { get; set; }

        public virtual int NavID { get; set; }

        public virtual string Rolename { get; set; }

        #region Object Overrides

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }

            var model = obj as PageGroupAccessPK;

            return model != null && this.NavID == model.NavID && this.Rolename == model.Rolename &&
                   this.ApplicationName == model.ApplicationName;
        }

        public override int GetHashCode()
        {
            return this.NavID.GetHashCode()
                ^ this.Rolename.GetHashCode()
                ^ this.ApplicationName.GetHashCode();
        }

        #endregion
    }
}
